home *** CD-ROM | disk | FTP | other *** search
- Path: prodigy.com!usenet
- From: FSMJ76A@prodigy.com (Stephen Pride)
- Newsgroups: comp.lang.c
- Subject: Command Line Wildcards (* and ?)
- Date: 1 Feb 1996 06:52:54 GMT
- Organization: Prodigy Services Company 1-800-PRODIGY
- Distribution: world
- Message-ID: <4epo06$170s@useneta1.news.prodigy.com>
- NNTP-Posting-Host: inugap5.news.prodigy.com
- X-Newsreader: Version 1.2
-
- Does anyone know how I could create a program that can accept wildcards
- (* and ?) for arguments and have the arguments linked into records of a
- database? For example (and this is a *crude* example):
-
- Suppose I have an ascii file. Each record in the ascii file is a nothing
- more than a char array (a person's name) that is terminated by a null and
- then a
- newline character, like this:
-
- John Doe
- Sarah Doe
- John Q. Public
-
- I want to create a program that can accept a variable number of arguments
- on the command line and also have any of the arguments contain wildcards.
- That is, if the program's name is DBPGM and I want to just find the
- records
- that start with "J" I would enter: DBPGM J*, and it would find only
- "John Doe"
- and "John Q Public" or: DBPGM *DOE and it would find "John Doe" and
- "Sarah Doe". I'm not looking for someone to write such a program, but
- instead I need help in converting the wildcard arguments into regular-
- expression strings. Sorry, I should have mentioned I am using Turbo C++
- and not Unix/C (which has such functions: regex/regcmp).
-
- Thanks!
- Steve
-
-
-